<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
        1.伪造用户代理
            window.navigator.userAgent  只读属性
     */
    // 1.1 打印这个对象
    // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
    console.log(window.navigator.userAgent)
    
    
    // 1.2 篡改这个属性
    window.navigator.__defineGetter__('userAgent', () => 'foobar');
    console.log(window.navigator.userAgent)
    
    // 1.3 还不如使用一些库来判断
    /*
         Bowser
         UAParser.js
         Platform.js
         CURRENT-DEVICE  Google Closure
         Mootools
     */
</script>
</body>
</html>